{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "735d1b8c-f49e-4e30-baa1-d8dcc0771112",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/root/miniconda3/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    "from datasets import Dataset, DatasetDict\n",
    "from transformers import AutoTokenizer\n",
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "9a4dcead-dd53-49ef-bdd5-96705cb59790",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def load_json_from_file(file_path):\n",
    "    try:\n",
    "        with open(file_path, 'r', encoding='utf-8') as file:\n",
    "            content = file.read().strip()  # 移除任何首尾空白字符\n",
    "            if not content:  # 检查是否为空文件\n",
    "                print(\"文件为空\")\n",
    "                return None\n",
    "            data = json.loads(content)\n",
    "            return data\n",
    "    except FileNotFoundError:\n",
    "        print(f\"文件 {file_path} 未找到\")\n",
    "    except json.JSONDecodeError as e:\n",
    "        print(f\"JSON解码错误: {e}\")\n",
    "        print(\"请检查文件内容是否为有效的JSON格式\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "3f1773e3-e47b-4952-8d21-8d74c3ae0b0c",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/gemini/code/datasets/test1_fullpath.json\n"
     ]
    }
   ],
   "source": [
    "root_dir = \"/\"\n",
    "# 魔搭train-data路径\n",
    "# train_path = os.path.join(root_dir, \"mnt\", \"workspace\", \"datasets\", \"doraemon-bot\", \"train\")\n",
    "# 趋动云train-data路径\n",
    "code_path = os.path.join(root_dir, \"gemini\", \"code\")\n",
    "code_datasets_path = os.path.join(code_path, \"datasets\")\n",
    "model_path = os.path.join(root_dir, \"gemini\", \"pretrain\")\n",
    "train_path = os.path.join(root_dir, \"gemini\", \"data-2\",)\n",
    "image_path = os.path.join(train_path, \"images\")\n",
    "\n",
    "test1_file_path = os.path.join(train_path, \"test1.json\")\n",
    "test1_file_fullpath = os.path.join(code_datasets_path, \"test1_fullpath.json\")\n",
    "# 趋动云 data-1路径只读，更新json到code目录\n",
    "print(test1_file_fullpath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7c063803-d8a1-4018-ba6c-fef882e2ffb1",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "scrolled": true,
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "写入新的JSON文件\n",
      "写入新的JSON文件完成， /gemini/code/test1_fullpath.json\n"
     ]
    }
   ],
   "source": [
    "# 使用函数加载JSON数据\n",
    "from pprint import pp\n",
    "data = load_json_from_file(test1_file_path)\n",
    "if data is not None:\n",
    "    # print(\"成功加载数据:\", data)\n",
    "    # pp(data)\n",
    "    for item in data:\n",
    "        if isinstance(item, dict):  # 确保元素是字典类型\n",
    "            # 修改image 加上路径：\n",
    "            if 'image' in item:\n",
    "                images_full_paths = [os.path.join(image_path, file_name) for file_name in item['image']]\n",
    "                item['image'] = images_full_paths\n",
    "\n",
    "    # 写入新的JSON文件\n",
    "    print(\"写入新的JSON文件\")\n",
    "    with open(test1_file_fullpath, 'w', encoding='utf-8') as file:\n",
    "        json.dump(data, file, ensure_ascii=False, indent=4)  # 编写数据到新的JSON文件\n",
    "print(\"写入新的JSON文件完成，\", test1_file_fullpath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "bd1be87e-d5c1-4db9-84c2-f02c72cc1156",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "execution": {
     "iopub.execute_input": "2024-12-23T09:06:40.864592Z",
     "iopub.status.busy": "2024-12-23T09:06:40.864254Z",
     "iopub.status.idle": "2024-12-23T09:06:40.867918Z",
     "shell.execute_reply": "2024-12-23T09:06:40.867339Z",
     "shell.execute_reply.started": "2024-12-23T09:06:40.864569Z"
    },
    "tags": []
   },
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid character '，' (U+FF0C) (1400768037.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  Cell \u001b[0;32mIn[2], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m    下面的代码是数据分析用的，可以留着\u001b[0m\n\u001b[0m                ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character '，' (U+FF0C)\n"
     ]
    }
   ],
   "source": [
    "下面的代码是数据分析用的，可以留着"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "c41300a2-cc63-4253-a258-538e2269178a",
   "metadata": {
    "ExecutionIndicator": {
     "show": false
    },
    "execution": {
     "iopub.execute_input": "2024-12-23T08:46:37.618718Z",
     "iopub.status.busy": "2024-12-23T08:46:37.618350Z",
     "iopub.status.idle": "2024-12-23T08:46:37.624126Z",
     "shell.execute_reply": "2024-12-23T08:46:37.623502Z",
     "shell.execute_reply.started": "2024-12-23T08:46:37.618693Z"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "def extract_data_with_images(data):\n",
    "    \"\"\"\n",
    "        解析读取到的json\n",
    "    \"\"\"\n",
    "    texts = []\n",
    "    labels = []\n",
    "    images = []\n",
    "    unique_labels = set(item['output'] for item in data)\n",
    "    label2id = {label: idx for idx, label in enumerate(unique_labels)}\n",
    "    id2label = {idx: label for label, idx in label2id.items()}\n",
    "    \n",
    "    for item in data:\n",
    "        text = item['instruction'] + \" \" + item.get('input', '')\n",
    "        label = item['output']\n",
    "        texts.append(text)\n",
    "        labels.append(label2id[label])\n",
    "        images_full_paths = [os.path.join(image_path, file_name) for file_name in item['image']]\n",
    "        images.append(images_full_paths)\n",
    "        \n",
    "        break\n",
    "    return texts, labels, images, label2id, id2label"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "56d97d89-cc33-44f2-9b6b-275894aa189c",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "execution": {
     "iopub.execute_input": "2024-12-23T08:46:38.771608Z",
     "iopub.status.busy": "2024-12-23T08:46:38.771240Z",
     "iopub.status.idle": "2024-12-23T08:46:38.775316Z",
     "shell.execute_reply": "2024-12-23T08:46:38.774754Z",
     "shell.execute_reply.started": "2024-12-23T08:46:38.771583Z"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['../../datasets/doraemon-bot/train/images/213e438b17282904772446704d0b28-0.jpg']\n",
      "<class 'list'>\n"
     ]
    }
   ],
   "source": [
    "# 假设data是之前加载的JSON数据列表\n",
    "texts, labels, images, label2id, id2label = extract_data_with_images(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "05da5e48-fd2c-4be3-8f3f-a70f6e5b20d8",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "execution": {
     "iopub.execute_input": "2024-12-23T08:31:27.440163Z",
     "iopub.status.busy": "2024-12-23T08:31:27.439809Z",
     "iopub.status.idle": "2024-12-23T08:31:27.446619Z",
     "shell.execute_reply": "2024-12-23T08:31:27.445939Z",
     "shell.execute_reply.started": "2024-12-23T08:31:27.440125Z"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1000"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(texts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5e314ba1-8681-44d1-8f40-4f81f2f5d61b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 遍历数据集中的每一个样本。\n",
    "for idx in range(num_samples):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0eeed8ce-a00c-46bd-81b3-c66aa8c003dc",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "execution": {
     "iopub.execute_input": "2024-12-23T08:37:06.383744Z",
     "iopub.status.busy": "2024-12-23T08:37:06.383370Z",
     "iopub.status.idle": "2024-12-23T08:37:06.399795Z",
     "shell.execute_reply": "2024-12-23T08:37:06.399086Z",
     "shell.execute_reply.started": "2024-12-23T08:37:06.383719Z"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "# 创建Dataset对象\n",
    "dataset = Dataset.from_dict({'text': texts, 'image': images, 'label': labels, })"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "ffeec551-7f7b-4fce-939b-81d26fe1f924",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "execution": {
     "iopub.execute_input": "2024-12-23T08:37:22.701067Z",
     "iopub.status.busy": "2024-12-23T08:37:22.700685Z",
     "iopub.status.idle": "2024-12-23T08:37:22.705223Z",
     "shell.execute_reply": "2024-12-23T08:37:22.704578Z",
     "shell.execute_reply.started": "2024-12-23T08:37:22.701041Z"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1000, 3)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "f40cac59-c2f0-464f-a3de-42acbf3ca68c",
   "metadata": {
    "ExecutionIndicator": {
     "show": true
    },
    "execution": {
     "iopub.execute_input": "2024-12-19T14:57:27.895087Z",
     "iopub.status.busy": "2024-12-19T14:57:27.894778Z",
     "iopub.status.idle": "2024-12-19T14:57:27.904614Z",
     "shell.execute_reply": "2024-12-19T14:57:27.904202Z",
     "shell.execute_reply.started": "2024-12-19T14:57:27.895068Z"
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[5,\n",
       " 5,\n",
       " 26,\n",
       " 25,\n",
       " 40,\n",
       " 45,\n",
       " 6,\n",
       " 21,\n",
       " 6,\n",
       " 21,\n",
       " 2,\n",
       " 44,\n",
       " 8,\n",
       " 20,\n",
       " 3,\n",
       " 3,\n",
       " 26,\n",
       " 3,\n",
       " 43,\n",
       " 26,\n",
       " 4,\n",
       " 45,\n",
       " 17,\n",
       " 6,\n",
       " 17,\n",
       " 43,\n",
       " 11,\n",
       " 17,\n",
       " 38,\n",
       " 17,\n",
       " 25,\n",
       " 30,\n",
       " 41,\n",
       " 11,\n",
       " 25,\n",
       " 26,\n",
       " 44,\n",
       " 3,\n",
       " 8,\n",
       " 11,\n",
       " 30,\n",
       " 45,\n",
       " 43,\n",
       " 38,\n",
       " 36,\n",
       " 11,\n",
       " 40,\n",
       " 43,\n",
       " 17,\n",
       " 4,\n",
       " 20,\n",
       " 41,\n",
       " 30,\n",
       " 20,\n",
       " 4,\n",
       " 43,\n",
       " 29,\n",
       " 3,\n",
       " 17,\n",
       " 3,\n",
       " 40,\n",
       " 8,\n",
       " 5,\n",
       " 38,\n",
       " 17,\n",
       " 11,\n",
       " 29,\n",
       " 6,\n",
       " 3,\n",
       " 40,\n",
       " 4,\n",
       " 27,\n",
       " 41,\n",
       " 36,\n",
       " 6,\n",
       " 26,\n",
       " 43,\n",
       " 6,\n",
       " 36,\n",
       " 6,\n",
       " 36,\n",
       " 36,\n",
       " 5,\n",
       " 41,\n",
       " 40,\n",
       " 44,\n",
       " 25,\n",
       " 8,\n",
       " 8,\n",
       " 43,\n",
       " 8,\n",
       " 29,\n",
       " 30,\n",
       " 3,\n",
       " 29,\n",
       " 20,\n",
       " 42,\n",
       " 42,\n",
       " 38,\n",
       " 30,\n",
       " 3,\n",
       " 44,\n",
       " 30,\n",
       " 44,\n",
       " 44,\n",
       " 30,\n",
       " 26,\n",
       " 43,\n",
       " 2,\n",
       " 29,\n",
       " 11,\n",
       " 25,\n",
       " 43,\n",
       " 41,\n",
       " 8,\n",
       " 20,\n",
       " 36,\n",
       " 44,\n",
       " 30,\n",
       " 11,\n",
       " 3,\n",
       " 30,\n",
       " 2,\n",
       " 42,\n",
       " 21,\n",
       " 8,\n",
       " 44,\n",
       " 5,\n",
       " 21,\n",
       " 30,\n",
       " 41,\n",
       " 36,\n",
       " 20,\n",
       " 8,\n",
       " 30,\n",
       " 17,\n",
       " 4,\n",
       " 40,\n",
       " 11,\n",
       " 4,\n",
       " 42,\n",
       " 43,\n",
       " 44,\n",
       " 20,\n",
       " 38,\n",
       " 43,\n",
       " 3,\n",
       " 38,\n",
       " 21,\n",
       " 3,\n",
       " 44,\n",
       " 29,\n",
       " 3,\n",
       " 36,\n",
       " 40,\n",
       " 26,\n",
       " 44,\n",
       " 40,\n",
       " 44,\n",
       " 26,\n",
       " 40,\n",
       " 27,\n",
       " 27,\n",
       " 42,\n",
       " 3,\n",
       " 44,\n",
       " 20,\n",
       " 42,\n",
       " 30,\n",
       " 36,\n",
       " 20,\n",
       " 11,\n",
       " 27,\n",
       " 20,\n",
       " 5,\n",
       " 4,\n",
       " 36,\n",
       " 43,\n",
       " 44,\n",
       " 25,\n",
       " 17,\n",
       " 17,\n",
       " 29,\n",
       " 5,\n",
       " 36,\n",
       " 3,\n",
       " 30,\n",
       " 4,\n",
       " 38,\n",
       " 17,\n",
       " 41,\n",
       " 17,\n",
       " 17,\n",
       " 6,\n",
       " 26,\n",
       " 44,\n",
       " 42,\n",
       " 27,\n",
       " 42,\n",
       " 27,\n",
       " 41,\n",
       " 2,\n",
       " 44,\n",
       " 41,\n",
       " 44,\n",
       " 43,\n",
       " 44,\n",
       " 11,\n",
       " 29,\n",
       " 44,\n",
       " 29,\n",
       " 5,\n",
       " 41,\n",
       " 17,\n",
       " 40,\n",
       " 25,\n",
       " 29,\n",
       " 36,\n",
       " 3,\n",
       " 43,\n",
       " 5,\n",
       " 41,\n",
       " 20,\n",
       " 44,\n",
       " 11,\n",
       " 20,\n",
       " 44,\n",
       " 6,\n",
       " 11,\n",
       " 30,\n",
       " 21,\n",
       " 41,\n",
       " 25,\n",
       " 41,\n",
       " 44,\n",
       " 30,\n",
       " 40,\n",
       " 44,\n",
       " 17,\n",
       " 43,\n",
       " 26,\n",
       " 41,\n",
       " 29,\n",
       " 17,\n",
       " 42,\n",
       " 26,\n",
       " 36,\n",
       " 8,\n",
       " 41,\n",
       " 40,\n",
       " 38,\n",
       " 21,\n",
       " 38,\n",
       " 5,\n",
       " 11,\n",
       " 5,\n",
       " 21,\n",
       " 27,\n",
       " 17,\n",
       " 44,\n",
       " 29,\n",
       " 26,\n",
       " 26,\n",
       " 5,\n",
       " 11,\n",
       " 8,\n",
       " 20,\n",
       " 25,\n",
       " 8,\n",
       " 36,\n",
       " 38,\n",
       " 27,\n",
       " 41,\n",
       " 30,\n",
       " 5,\n",
       " 11,\n",
       " 30,\n",
       " 6,\n",
       " 43,\n",
       " 45,\n",
       " 38,\n",
       " 41,\n",
       " 38,\n",
       " 3,\n",
       " 6,\n",
       " 27,\n",
       " 11,\n",
       " 5,\n",
       " 41,\n",
       " 11,\n",
       " 30,\n",
       " 30,\n",
       " 27,\n",
       " 38,\n",
       " 38,\n",
       " 36,\n",
       " 30,\n",
       " 20,\n",
       " 43,\n",
       " 8,\n",
       " 34,\n",
       " 10,\n",
       " 37,\n",
       " 37,\n",
       " 18,\n",
       " 7,\n",
       " 14,\n",
       " 1,\n",
       " 12,\n",
       " 24,\n",
       " 13,\n",
       " 34,\n",
       " 33,\n",
       " 31,\n",
       " 15,\n",
       " 28,\n",
       " 39,\n",
       " 10,\n",
       " 31,\n",
       " 37,\n",
       " 10,\n",
       " 24,\n",
       " 14,\n",
       " 9,\n",
       " 39,\n",
       " 0,\n",
       " 9,\n",
       " 9,\n",
       " 22,\n",
       " 1,\n",
       " 34,\n",
       " 22,\n",
       " 12,\n",
       " 9,\n",
       " 32,\n",
       " 12,\n",
       " 33,\n",
       " 39,\n",
       " 35,\n",
       " 10,\n",
       " 39,\n",
       " 13,\n",
       " 0,\n",
       " 22,\n",
       " 37,\n",
       " 9,\n",
       " 7,\n",
       " 14,\n",
       " 1,\n",
       " 10,\n",
       " 15,\n",
       " 13,\n",
       " 14,\n",
       " 18,\n",
       " 28,\n",
       " 24,\n",
       " 31,\n",
       " 23,\n",
       " 9,\n",
       " 24,\n",
       " 18,\n",
       " 39,\n",
       " 39,\n",
       " 19,\n",
       " 12,\n",
       " 13,\n",
       " 15,\n",
       " 10,\n",
       " 24,\n",
       " 33,\n",
       " 23,\n",
       " 13,\n",
       " 16,\n",
       " 22,\n",
       " 37,\n",
       " 22,\n",
       " 10,\n",
       " 13,\n",
       " 33,\n",
       " 15,\n",
       " 14,\n",
       " 15,\n",
       " 28,\n",
       " 39,\n",
       " 14,\n",
       " 12,\n",
       " 34,\n",
       " 7,\n",
       " 14,\n",
       " 37,\n",
       " 33,\n",
       " 12,\n",
       " 23,\n",
       " 10,\n",
       " 1,\n",
       " 7,\n",
       " 7,\n",
       " 19,\n",
       " 34,\n",
       " 14,\n",
       " 16,\n",
       " 28,\n",
       " 33,\n",
       " 22,\n",
       " 35,\n",
       " 37,\n",
       " 33,\n",
       " 22,\n",
       " 37,\n",
       " 13,\n",
       " 35,\n",
       " 15,\n",
       " 32,\n",
       " 14,\n",
       " 0,\n",
       " 12,\n",
       " 7,\n",
       " 14,\n",
       " 39,\n",
       " 39,\n",
       " 13,\n",
       " 33,\n",
       " 7,\n",
       " 7,\n",
       " 1,\n",
       " 12,\n",
       " 37,\n",
       " 19,\n",
       " 34,\n",
       " 39,\n",
       " 23,\n",
       " 13,\n",
       " 22,\n",
       " 1,\n",
       " 12,\n",
       " 35,\n",
       " 32,\n",
       " 7,\n",
       " 28,\n",
       " 0,\n",
       " 13,\n",
       " 34,\n",
       " 35,\n",
       " 10,\n",
       " 31,\n",
       " 23,\n",
       " 13,\n",
       " 7,\n",
       " 31,\n",
       " 23,\n",
       " 0,\n",
       " 0,\n",
       " 14,\n",
       " 37,\n",
       " 1,\n",
       " 33,\n",
       " 12,\n",
       " 33,\n",
       " 15,\n",
       " 1,\n",
       " 15,\n",
       " 35,\n",
       " 23,\n",
       " 9,\n",
       " 34,\n",
       " 1,\n",
       " 31,\n",
       " 7,\n",
       " 7,\n",
       " 19,\n",
       " 7,\n",
       " 0,\n",
       " 31,\n",
       " 23,\n",
       " 13,\n",
       " 10,\n",
       " 1,\n",
       " 34,\n",
       " 7,\n",
       " 1,\n",
       " 9,\n",
       " 15,\n",
       " 10,\n",
       " 32,\n",
       " 16,\n",
       " 28,\n",
       " 22,\n",
       " 12,\n",
       " 28,\n",
       " 19,\n",
       " 35,\n",
       " 12,\n",
       " 13,\n",
       " 16,\n",
       " 13,\n",
       " 34,\n",
       " 23,\n",
       " 31,\n",
       " 7,\n",
       " 18,\n",
       " 1,\n",
       " 35,\n",
       " 14,\n",
       " 16,\n",
       " 18,\n",
       " 10,\n",
       " 16,\n",
       " 23,\n",
       " 37,\n",
       " 39,\n",
       " 22,\n",
       " 32,\n",
       " 37,\n",
       " 33,\n",
       " 39,\n",
       " 15,\n",
       " 18,\n",
       " 39,\n",
       " 37,\n",
       " 28,\n",
       " 22,\n",
       " 0,\n",
       " 18,\n",
       " 35,\n",
       " 22,\n",
       " 34,\n",
       " 31,\n",
       " 7,\n",
       " 37,\n",
       " 18,\n",
       " 22,\n",
       " 18,\n",
       " 32,\n",
       " 39,\n",
       " 12,\n",
       " 37,\n",
       " 14,\n",
       " 35,\n",
       " 16,\n",
       " 15,\n",
       " 24,\n",
       " 37,\n",
       " 13,\n",
       " 1,\n",
       " 35,\n",
       " 9,\n",
       " 32,\n",
       " 19,\n",
       " 16,\n",
       " 19,\n",
       " 14,\n",
       " 18,\n",
       " 7,\n",
       " 24,\n",
       " 34,\n",
       " 9,\n",
       " 34,\n",
       " 13,\n",
       " 22,\n",
       " 31,\n",
       " 33,\n",
       " 34,\n",
       " 23,\n",
       " 15,\n",
       " 33,\n",
       " 18,\n",
       " 34,\n",
       " 1,\n",
       " 1,\n",
       " 18,\n",
       " 7,\n",
       " 33,\n",
       " 23,\n",
       " 9,\n",
       " 7,\n",
       " 28,\n",
       " 31,\n",
       " 1,\n",
       " 32,\n",
       " 9,\n",
       " 13,\n",
       " 15,\n",
       " 31,\n",
       " 15,\n",
       " 7,\n",
       " 18,\n",
       " 39,\n",
       " 39,\n",
       " 16,\n",
       " 37,\n",
       " 22,\n",
       " 18,\n",
       " 16,\n",
       " 28,\n",
       " 13,\n",
       " 23,\n",
       " 23,\n",
       " 18,\n",
       " 33,\n",
       " 19,\n",
       " 19,\n",
       " 13,\n",
       " 33,\n",
       " 1,\n",
       " 10,\n",
       " 19,\n",
       " 24,\n",
       " 9,\n",
       " 22,\n",
       " 18,\n",
       " 33,\n",
       " 13,\n",
       " 37,\n",
       " 13,\n",
       " 31,\n",
       " 13,\n",
       " 18,\n",
       " 22,\n",
       " 24,\n",
       " 1,\n",
       " 13,\n",
       " 31,\n",
       " 13,\n",
       " 28,\n",
       " 34,\n",
       " 12,\n",
       " 15,\n",
       " 16,\n",
       " 14,\n",
       " 1,\n",
       " 9,\n",
       " 31,\n",
       " 33,\n",
       " 34,\n",
       " 34,\n",
       " 22,\n",
       " 39,\n",
       " 39,\n",
       " 22,\n",
       " 7,\n",
       " 22,\n",
       " 1,\n",
       " 9,\n",
       " 23,\n",
       " 13,\n",
       " 35,\n",
       " 15,\n",
       " 35,\n",
       " 39,\n",
       " 7,\n",
       " 39,\n",
       " 22,\n",
       " 12,\n",
       " 39,\n",
       " 33,\n",
       " 0,\n",
       " 24,\n",
       " 1,\n",
       " 1,\n",
       " 7,\n",
       " 34,\n",
       " 39,\n",
       " 13,\n",
       " 1,\n",
       " 14,\n",
       " 31,\n",
       " 16,\n",
       " 15,\n",
       " 39,\n",
       " 28,\n",
       " 34,\n",
       " 28,\n",
       " 14,\n",
       " 39,\n",
       " 34,\n",
       " 28,\n",
       " 9,\n",
       " 16,\n",
       " 1,\n",
       " 35,\n",
       " 1,\n",
       " 7,\n",
       " 31,\n",
       " 18,\n",
       " 33,\n",
       " 16,\n",
       " 37,\n",
       " 22,\n",
       " 23,\n",
       " 14,\n",
       " 22,\n",
       " 33,\n",
       " 1,\n",
       " 9,\n",
       " 9,\n",
       " 34,\n",
       " 0,\n",
       " 0,\n",
       " 12,\n",
       " 28,\n",
       " 31,\n",
       " 16,\n",
       " 39,\n",
       " 33,\n",
       " 10,\n",
       " 18,\n",
       " 35,\n",
       " 35,\n",
       " 33,\n",
       " 23,\n",
       " 37,\n",
       " 16,\n",
       " 35,\n",
       " 15,\n",
       " 18,\n",
       " 12,\n",
       " 23,\n",
       " 16,\n",
       " 19,\n",
       " 22,\n",
       " 28,\n",
       " 13,\n",
       " 34,\n",
       " 34,\n",
       " 22,\n",
       " 31,\n",
       " 33,\n",
       " 18,\n",
       " 0,\n",
       " 9,\n",
       " 9,\n",
       " 23,\n",
       " 16,\n",
       " 35,\n",
       " 35,\n",
       " 33,\n",
       " 16,\n",
       " 7,\n",
       " 33,\n",
       " 9,\n",
       " 22,\n",
       " 24,\n",
       " 13,\n",
       " 7,\n",
       " 23,\n",
       " 9,\n",
       " 23,\n",
       " 18,\n",
       " 33,\n",
       " 15,\n",
       " 35,\n",
       " 31,\n",
       " 1,\n",
       " 0,\n",
       " 31,\n",
       " 14,\n",
       " 0,\n",
       " 37,\n",
       " 1,\n",
       " 23,\n",
       " 16,\n",
       " 1,\n",
       " 34,\n",
       " 39,\n",
       " 34,\n",
       " 18,\n",
       " 28,\n",
       " 28,\n",
       " 1,\n",
       " 15,\n",
       " 39,\n",
       " 15,\n",
       " 24,\n",
       " 18,\n",
       " 1,\n",
       " 0,\n",
       " 35,\n",
       " 15,\n",
       " 34,\n",
       " 7,\n",
       " 33,\n",
       " 39,\n",
       " 14,\n",
       " 28,\n",
       " 28,\n",
       " 22,\n",
       " 19,\n",
       " 9,\n",
       " 14,\n",
       " 12,\n",
       " 31,\n",
       " 24,\n",
       " 39,\n",
       " 19,\n",
       " 9,\n",
       " 24,\n",
       " 34,\n",
       " 24,\n",
       " 16,\n",
       " 15,\n",
       " 13,\n",
       " 31,\n",
       " 7,\n",
       " 16,\n",
       " 35,\n",
       " 9,\n",
       " 37,\n",
       " 16,\n",
       " 9,\n",
       " 22,\n",
       " 1,\n",
       " 10,\n",
       " 32,\n",
       " 22,\n",
       " 33,\n",
       " 34,\n",
       " 18,\n",
       " 9,\n",
       " 7,\n",
       " 13,\n",
       " 16,\n",
       " 33,\n",
       " 1,\n",
       " 24,\n",
       " 23,\n",
       " 12,\n",
       " 24,\n",
       " 24,\n",
       " 22,\n",
       " 31,\n",
       " 12,\n",
       " 31,\n",
       " 23,\n",
       " 10,\n",
       " 37,\n",
       " 23,\n",
       " 35,\n",
       " 23,\n",
       " 13,\n",
       " 9,\n",
       " 9,\n",
       " 15,\n",
       " 37,\n",
       " 23,\n",
       " 13,\n",
       " 37,\n",
       " 7,\n",
       " 19,\n",
       " 31,\n",
       " 9,\n",
       " 12,\n",
       " 7,\n",
       " 13,\n",
       " 23,\n",
       " 18,\n",
       " 10,\n",
       " 34,\n",
       " 7,\n",
       " 14,\n",
       " 23,\n",
       " 9,\n",
       " 12,\n",
       " 1,\n",
       " 35,\n",
       " 12,\n",
       " 10,\n",
       " 24,\n",
       " 12,\n",
       " 34,\n",
       " 13,\n",
       " 31,\n",
       " 39,\n",
       " 15,\n",
       " 31,\n",
       " 39,\n",
       " 33,\n",
       " 34,\n",
       " 23,\n",
       " 16,\n",
       " 22,\n",
       " 32,\n",
       " 34,\n",
       " 7,\n",
       " 32,\n",
       " 10,\n",
       " 28,\n",
       " 15,\n",
       " 39,\n",
       " 13,\n",
       " 12,\n",
       " 24,\n",
       " 9,\n",
       " 15,\n",
       " 37,\n",
       " 23,\n",
       " 23,\n",
       " 34,\n",
       " 23,\n",
       " 31,\n",
       " 15,\n",
       " 7,\n",
       " 16,\n",
       " 39,\n",
       " 37,\n",
       " 12,\n",
       " 34,\n",
       " 18,\n",
       " 7,\n",
       " 1,\n",
       " 13,\n",
       " 12,\n",
       " 18,\n",
       " 23,\n",
       " 33,\n",
       " 37,\n",
       " 31,\n",
       " 12,\n",
       " 18,\n",
       " 31,\n",
       " 33,\n",
       " 16,\n",
       " 23,\n",
       " 18,\n",
       " 12,\n",
       " 24,\n",
       " 10,\n",
       " 18,\n",
       " 15,\n",
       " 33,\n",
       " 0,\n",
       " 15,\n",
       " 12,\n",
       " 34,\n",
       " 7,\n",
       " 9,\n",
       " 39,\n",
       " 33,\n",
       " 0,\n",
       " 31,\n",
       " 10,\n",
       " 33,\n",
       " 35,\n",
       " 31,\n",
       " 37,\n",
       " 19,\n",
       " 13,\n",
       " 33,\n",
       " 28,\n",
       " 34,\n",
       " 31,\n",
       " 18,\n",
       " 24,\n",
       " 32,\n",
       " 28,\n",
       " 32,\n",
       " 7,\n",
       " 24,\n",
       " 1,\n",
       " 31,\n",
       " 13,\n",
       " 22,\n",
       " 1,\n",
       " 39,\n",
       " 31,\n",
       " 31,\n",
       " 32,\n",
       " 0,\n",
       " 39,\n",
       " 28,\n",
       " 33,\n",
       " 18,\n",
       " 18,\n",
       " 15,\n",
       " 39,\n",
       " 14,\n",
       " 28,\n",
       " 13,\n",
       " 32,\n",
       " 9,\n",
       " 12,\n",
       " 18,\n",
       " 10,\n",
       " 22,\n",
       " 18,\n",
       " 16,\n",
       " 37,\n",
       " 7,\n",
       " 35,\n",
       " 28,\n",
       " 23,\n",
       " 9,\n",
       " 10,\n",
       " 22,\n",
       " 14,\n",
       " 35,\n",
       " 1,\n",
       " 18,\n",
       " 14,\n",
       " 22,\n",
       " 9]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "labels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "48c83181-8ff7-49ba-922a-94fbafc7e3e3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
